package com.yixun.qfbao.interceptor.forbidrepeatclick.response;

import org.springframework.stereotype.Component;

import com.yixun.qfbao.response.BaseResponse;
import com.yixun.qfbao.xf.model.enums.ResultEnum;

/**
 * @author zilong.liu
 * @date 2020-11-24
 *
 * desc:
 * 	
 *     
 */
@Component("baseResponseTypeResponse")
public class BaseResponseTypeResponse implements ResTypeResponse{

	@SuppressWarnings("rawtypes")
	private static final BaseResponse baseResponse = new BaseResponse();

	
	static {
		baseResponse.setCode(ResultEnum.REPEAT_CLICK.getNo());
	}
	
	/**
	 * 
	 * @return
	 */
	@Override
	public Object getResObj() {
		return baseResponse;
	}	
	
	/**
	 * 
	 * @return
	 */
	@Override
	public Object getExceptionResObj(String errorMsg) {
		@SuppressWarnings("rawtypes")
		BaseResponse exceptionBaseResponse = new BaseResponse();
		exceptionBaseResponse.setCode(ResultEnum.FAIL.getNo());
		exceptionBaseResponse.setMsg(errorMsg);
		return exceptionBaseResponse;
	}	
}
